﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class WallManager : MonoBehaviour {

    public List<WallAnimation> wa;
    int cur = 0;
    float speed = 10;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            Debug.Log("space");
            //Move();
            wa[cur].Move(speed);
            cur++;
            if (cur >= wa.Count) {
                cur = 0;
                speed = speed * 0.8f;
                Debug.Log(speed);
            }
        }
        if (Input.GetKeyDown(KeyCode.R)){
            for(int i = 0; i < wa.Count; i++)
            {
                wa[i].Reset();
            }
        }
   
    }
}
